impl Solution {
    pub fn remove_covered_intervals(mut intervals: Vec<Vec<i32>>) -> i32 {
        intervals.sort_by(|a,b|{
            if a[0]==b[0]{
                i32::cmp(&b[1], &a[1])
            }else{
                i32::cmp(&a[0], &b[0])
            }
        });
        let mut r =Option::<i32>::None;
        intervals.iter().fold(0, |acc,x|{
            if let Some(t)=r{
                if t>=x[1]{
                    return acc;
                }
            }
            r=Some(x[1]);
            acc+1
        })
    }
}